#include <iostream>
#include <cstdio>
using namespace std;
typedef long long LL;
const LL MOD = 1e9+7;
LL Kuai(LL ask, LL k) {
    LL res = 1;
    while (k) {
        if (k&1) {
            res = (res*ask) % MOD;
        }
        k = (k>>1);
        ask = (ask*ask) % MOD;
    }
    return res;
}
LL C(LL n, LL k) {
    if (k>n/2) k = n - k;
    LL res = 1;
    for (int i=0; i<k; ++i) {
        res = res * (n-i) % MOD * Kuai(i+1, MOD-2) % MOD;
    }
    return res;
}
int main(int argc, char** argv) {
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    int n=a+b+c+d;
    LL res = 1;
    res = res * C(n, a) % MOD;
    n-=a;
    res = (res * C(n, b)) % MOD;
    n-=b;
    res = (res * C(n, c)) % MOD;
    n-=c;
    res = (res * C(n, d)) % MOD;
    cout<<res<<endl;
    return 0;
}
